﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;

namespace DownCode
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }





        private void button1_Click(object sender, EventArgs e)
        {
            var list1 = MainClass.GetListForVersion();
            var list2 = MainClass.GetListForPath(@"E:\Test\project.manifest");

            foreach (var mod1 in list1)
            {
                var name1 = mod1.Name;
                var md51 = mod1.Md5;

                if (list2.Exists(a => a.Name == name1))
                {
                    var mod2 = list2.First(a => a.Name == name1);
                    if (md51 != mod2.Md5)
                        MainClass.DownPath(name1);
                }
                else
                {
                    MainClass.DownPath(name1);
                }
            }
            MessageBox.Show("aaaa");
        }
    }
}
